package com.r2coding.core.exception;

import com.r2coding.core.response.ResponseCode;
import lombok.Data;

/**
 * @author 98k灬
 * @version v1.0.0
 * @Description : 自定义全局业务异常信息
 * @Create on : 2023/9/15 12:18
 **/
@Data
public class Pan4jException extends RuntimeException {

    private static final long serialVersionUID = -8800824764840619721L;

    private Integer code;

    private String message;

    public Pan4jException(ResponseCode responseCode) {
        this.code = responseCode.getCode();
        this.message = responseCode.getDesc();
    }

    public Pan4jException(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Pan4jException(String message) {
        this.code = ResponseCode.ERROR.getCode();
        this.message = message;
    }

    public Pan4jException() {
        this.code = ResponseCode.ERROR.getCode();
        this.message = ResponseCode.ERROR.getDesc();
    }
}
